package com.huanbao.nongwu.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huanbao.common.pojo.nwrabc.SysUserRole;
import com.huanbao.nongwu.dao.SysUserRoleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysUserRoleServiceImpl{
	
	@Autowired
	private SysUserRoleDao sysUserRoleDao;

	public int deleteByPrimaryKey(Integer id) {
		int count = sysUserRoleDao.deleteById(id);
		return count;
	}

	public int insert(SysUserRole record) {
		int count =sysUserRoleDao.insert(record);
		return count;
	}

	public int deleteUserRoleByUserId(Integer userId) {
		QueryWrapper<SysUserRole> emp = new QueryWrapper<>();
		emp.eq("userid",userId);
		int count = sysUserRoleDao.delete(emp);
		return count;
	}




	
}
